home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
wb
/
czesc_2
/
iobject
/
doc
/
iobject.doceng
next >
Wrap
Text File
|
1993-03-31
|
22KB
|
932 lines
TABLE OF CONTENTS
IObject.lib/ActivateObject
IObject.lib/AddObjectToWindow
IObject.lib/AdjustBox
IObject.lib/ClearTextArea
IObject.lib/CreateObject
IObject.lib/CreateTextArea
IObject.lib/DisplayObject
IObject.lib/Draw3DBox
IObject.lib/EraseObject
IObject.lib/ExitEasyGadget
IObject.lib/FindObjectMsg
IObject.lib/FreeObject
IObject.lib/FreeTextArea
IObject.lib/GetHotKey
IObject.lib/GetObjectID
IObject.lib/InitEasyGadget
IObject.lib/ModifyObject
IObject.lib/ObjectValue
IObject.lib/OffObject
IObject.lib/OnObject
IObject.lib/RemoveObjectFromWindow
IObject.lib/SendMsgToObject
IObject.lib/SetIObjectColors
IObject.lib/SetTextAreaPen
IObject.lib/TAPrint
IObject.lib/TAPrintf
IObject.lib/TAPuts
IObject.lib/ActivateObject IObject.lib/ActivateObject
NAME ActivateObject() -- Simulate activation of a IObject
ActivateObject(object);
VOID ActivateObject(CPTR);
DESCRIPTION
Simulate IObject activation by a user, by this way you can simulate hot-
keys. This fonction doesn't works with all IObjects (for ex. activate a
Scroller don't have any meaning).
INPUTS
object - pointer to IObject.
RESULT
none
BUGS
none known
IObject.lib/AddObjectToWindow IObject.lib/AddObjectToWindow
NAME AddObjectToWindow() -- Ajoute un IObject à une fenêtre
AddObjectToWindow(object, window, requester);
VOID AddObjectToWindow(CPTR, struct Window *, struct Requester *);
DESCRIPTION
Add an IObject to a window, the IObject is not displayed on the window.
(You must use DisplayObject() to display it.). The window must have the
IDCMP flags associated to IObjects set (IDCMP_xxxx).
INPUTS
object - pointer to IObject.
window - pointer to the window for the IObject.
requester - pointer to requester for the IObject.
RESULT
none
BUGS
By now, you can add an IObject to a requester. You must put NULL for the
requester.
SEE ALSO
RemoveObjectFromWindow()
IObject.lib/AdjustBox IObject.lib/AdjustBox
NAME AdjustBox() -- Calculate a box in a border
AdjustBox(box, simple);
VOID AdjustBox(struct Box *, BOOL);
DESCRIPTION
You can calculate the size and the position of a box in a border (single
or double) defined by box.
INPUTS
box - the box to be adjusted. (box is modified)
simple - TRUE if it's a single border (BOX_1IN or BOX_1OUT).
RESULT
none
BUGS
none known
IObject.lib/ClearTextArea IObject.lib/ClearTextArea
NAME ClearTextArea() -- clear the TextArea
ClearTextArea(textarea);
VOID ClearTextArea(CPTR);
DESCRIPTION
Clear the TextArea, and move the current position to top left.
INPUTS
textarea - pointer to textarea.
RESULT
none
IObject.lib/Createxxxx IObject.lib/Createxxxx
NAME Createxxxx() -- Create an IObject
object = Createxxxx(new, id);
CPTR Createxxxx(struct Newxxxx *, ULONG);
DESCRIPTION
Each classe of IObjects owns a structure NewObject:
struct NewObject
{
UWORD LeftEdge, TopEdge;
UWORD Width, Height;
UWORD Flags;
UWORD ClassFlags;
STRPTR LabelText;
struct TextAttr *Font;
};
LeftEdge, TopEdge - Position of the IObjet in the window.
Width, Height - Size of IObject.
Flags - Flags for all classes of IObject. To put the label
regarding to IOject (LABEL_ABOVE above the IObject,
LABEL_BELOW below the IObject, LABEL_RIGHT at right,
LABEL_LEFT at left, LABEL_INSIDE inside), with
LABEL_HOT_KEY the car next '_' in the label will be
underlined, LABEL_PEN2 will use Pen2 color to display
the label (Pen1 is uesd by default),with OBJ_DISABLED
the IObject will be ghosted.
ClassFlags - flags for eache classe (See further).
LabelText - Label text (may be NULL).
Font - Font for the IObject (label and text). A programm
which use IObject.lib must declare DiskfontBase, if
you don't open the diskfont.library, put NULL into
DiskfontBase, you will only be able to use ROM fonts.
If the font can't be opened or if Font is NULL,
IObject.lib will use the font Topaz 8.
CLASS_CYCLE:
CPTR CreateCycle(struct NewCycle *, ULONG);
Create an IObject to choose une option among several options.
struct NewCycle
{
struct NewObject NewObj;
STRPTR *TextArray;
};
ClassFlags - no flags for the Cycle.
TextArea - array to strings for options, a NULL must follow the last
string.
CLASS_BUTTON:
CPTR CreateButton(struct NewButton *, ULONG);
Create a button, it can be use as a switch with BT_TOGGLE flag.
struct NewButton
{
struct NewObject NewObj;
};
ClassFlags - BT_TOGGLE to create a switch, it can be on or off. With
BT_SELECTED the switch will be on.
CLASS_SCROLLER
CPTR CreateScroller(struct NewScroller *, ULONG);
Crée un IObject proportionnel, comme ceux utilisés dans les éditeurs de
textes pour ce déplacer dans le texte: indique le nombre de lignes
visible par rapport au nombre totale de ligne et la position dans le
texte.
struct NewScroller
{
struct NewObject NewObj;
UWORD Pos;
UWORD CurSize;
UWORD MaxSize;
};
ClassFlags - SC_VERTICAL to have a vertical scroller, with SC_NOMOUSE
mouse move
Pos - Position du knob dans le scroller: de zéro à MaxSize.
CurSize - Correspond à la partie visible.
MaxSize - Correspond à la partie totale.
CLASS_CHECK:
CPTR CreateCheck(struct NewCheck *, ULONG);
Create an IObject to be marked.
struct NewCheck
{
struct NewObject NewObj;
};
ClassFlags - CK_CHECKED if the IObject is marked.
CLASS_STRING:
CPTR CreateString(struct NewString *, ULONG);
Create an IObject to enter strings.
struct NewString
{
struct NewObject NewObj;
STRPTR Text;
UWORD MaxLength;
};
ClassFlags - STR_SINGLEBORD will use a single border instead of a double
border, STR_RIGHT will puts the texte at right, STR_CENTER
will center the text.
Text - Initial string (may be NULL).
MaxLength - Length maximal for the string (must less than 280 charaters
by now.)
CLASS_INTEGER:
CPTR CreateInteger(struct NewInteger *, ULONG);
Create an IObject to pick a signed integer, you can specify minimun and
maximum for the integer with ModifyObject(). (by default LONG_MIN and
LONG_MAX.)
struct NewInteger
{
struct NewObject NewObj;
};
ClassFlags - see String ClassFlags.
INPUTS
new - pointer to Newxxxx structure corresponding to IObject classe.
id - identification for user.
RESULTS
object - pointer to IObject or NULL if not enough memory.
BUGS
none known
SEE ASLO
FreeObject(), ModifyObject()
IObject.lib/CreateTextArea IObject.lib/CreateTextArea
NAME CreateTextArea() -- Create a TextArea
textarea = CreateTextArea(newtextarea, rastport);
CPTR CreateTextArea(struct NewTextArea *, struct RastPort *);
DESCRIPTION
Create a TextArea to display text, the text will scroll when the botton
of the TextArea is reached. La structure NewTextArea is defined by:
struct NewTextArea
{
UWORD LeftEdge, TopEdge;
UWORD Width, Height;
UWORD Flags;
UWORD ClassFlags;
STRPTR LabelText;
struct TextAttr *Font;
UBYTE FrontPen, BackPen;
UBYTE InterLine;
UBYTE WrMask;
};
LeftEdge, TopEdge - define position of the TextArea in the rastport.
Width, Height - define size of the TextArea in the rastport.
Flags - LABEL_ABOVE, LABEL_RIGHT, LABEK_LEFT, LABEL_BELOW,
LABEL_PEN2 (see CreateObject.)
ClassFlags - Flags for the TextArea: TAF_SMOOTH_SCROLL for smooth
scrolling (takes more times), with TAF_CLIP_TEXT text
which is larger than the TextArea is displayed on the
following line, else the remaining text is not
displayed.
LabelText - Label of TextArea.
Font - Font for the TextArea.
FrontPen - Text color in the TextArea.
BackPen - Background color in the TextArea.
InterLine - Spacing between two lines, 1 is usually enough. (0 is
possible).
WrMask - Mask for TextArea bitplanes, bits 1 to 8 indicate
which bitplanes are used by the TextArea, (a bit set
means use the corresponding bitplane. For example for
a 3 bitplane depth screen, if you wants to use all the
colors put 0x07, if you to use only colors 1 to 4
puts 0x03. This field is related to the WrMask field
in the RastPort structure. Put -1 if you don't known ne vous savez pas quoi mettre. (Moins il y a de
which value to use. (the less bitplanes wil be used
the faster will be the displaying, if you put 0,
nothing will be displayed.
INPUTS
newtextarea - pointer to a NewTextArea structure.
rastport - pointer to rastport.
RESULT
textarea - pointer to a TextArea or NULL if no memory.
SEE ALSO
FreeTextArea(), TAPrint(), TAPrintf(), TAPuts(), graphics/rastport.h
IObject.lib/DisplayObject IObject.lib/DisplayObject
NAME DisplayObject() -- Display an IObject
DisplayObject(object);
VOID DisplayObject(CPTR);
DESCRIPTION
Display an IObject in its window, you MUST add the IObject to a window
with AddObjectToWindow() before using DisplayObject().
INPUTS
object - pointer to IObject.
RESULT
none
BUGS
none known
SEE ALSO
EraseObject()
IObject.lib/Draw3DBox IObject.lib/Draw3DBox
NAME Draw3DBox() -- Draw a 3D border
Draw3DBox(bow, rastport, type);
VOID Draw3DBox(struct Box *, struct RastPort *, ULONG);
DESCRIPTION
Draw a border defined by box, the border can be single or double.
INPUTS
box - pointer to a box.
rastport - pointer to a rastport.
type - type of border: BOX_1IN, BOX_1OUT, BOX_2IN and BOX_2OUT.
RESULT
none
SEE ALSO
SetIObjectColors()
IObject.lib/EraseObject IObject.lib/EraseObject
NAME EraseObject() -- Erase an IObject
EraseObject(object);
VOID EraseObject(CPTR);
DESCRIPTION
Erase an IObject from its window, the IObject isn't removed from the
window, it is only erased.
INPUTS
object - pointer to IObject.
RESULT
none
BUGS
none known
SEE ALSO
DisplayObject()
IObject.lib/ExitEasyGadget IObject.lib/ExitEasyGadget
NAME ExitEasyGadget() -- Free memory use by IObject.lib
ExitEasyGadget();
VOID ExitEasyGadget();
DESCRIPTION
Before exiting you MUST call ExitEasyGadget().
INPUTS
none
RESULT
none
BUGS
none known
SEE ALSO
InitEasyGadget()
IObject.lib/FindObjectMsg IObject.lib/FindObjectMsg
NAME FindObjectMsg() -- Find the IObject associated to the message
object = FindObjectMsg(message);
CPTR FindObjectMsg(struct IntuiMessage *);
DESCRIPTION
Look for which IObject the IntuiMessage pertains, result is the pointer
to an IObject if message pertains to an IObject or else NULL.
INPUTS
message - pointer to an IntuiMessage structure.
RESULT
object - pointer to IObject associated to IntuiMessage or NULL.
BUGS
none known
IObject.lib/FreeObject IObject.lib/FreeObject
NAME FreeObject() -- Free an IObject
FreeObject(object);
VOID FreeObject(CPTR);
DESCRIPTION
Free memory used by the IObject, you must remove the IObject from the
window before free it unless.
INPUTS
object - pointer to IObject.
RESULT
none
BUGS
none known
SEE ALSO
Createxxx()
IObject.lib/FreeTextArea IObject.lib/FreeTextArea
NAME FreeTextArea() -- Free a TextArea
FreeTextArea(textarea);
VOID FreeTextArea(CPTR);
DESCRIPTION
Frees the TextArea created by CreateTextArea().
INPUTS
textarea - pointer to TextArea.
RESULT
none
BUGS
none known
SEE ALSO
CreateTextArea()
IObject.lib/GetHotKey IObject.lib/GetHotKey
NAME GetHotKey() -- Returns the HotKey of an IObject
car = GetHotKey(object);
UBYTE GetHotKey(CPTR);
DESCRIPTION
Returns the hot-key use by the IObject, returns 0 if there is no hot-key.
(If the IObject is ghosted it always returns 0.)
INPUTS
object - pointer to IObject.
RESULT
car - the hot-key or 0.
BUGS
none known
IObject.lib/GetObjectID IObject.lib/GetObjectID
NAME GetObjectID() -- Returns the ID of the IObject
id = GetObjectID(object);
UWORD GetObjectID(CPTR);
DESCRIPTION
Returns the ID of IObject given a its creation.
INPUTS
object - pointer to IObject.
RESULT
id - le number given to the IObject.
BUGS
none known
IObject.lib/InitEasyGadget IObject.lib/InitEasyGadget
NAME InitEasyGadget() -- Initialize IObject.lib
res = InitEasyGadget();
BOOL InitEasyGadget();
DESCRIPTION
You MUST call this routine before using IObject.lib, returns TRUE if you
can use the library or FALSE else.
INPUTS
none
RESULT
res - returns TRUE if you can use IObject.lib or FALSE else.
BUGS
none known
SEE ALSO
ExitEasyGadget()
IObject.lib/ModifyObject IObject.lib/ModifyObject
NAME ModifyObject() -- Modify an IObject.
ModifyObject(object, arg0, arg1, ...);
VOID ModifyObject(CPTR, ...);
DESCRIPTION
Modify an IObject, prototype depends of IObject classe.
INPUTS
object - pointer to IObject.
CLASS_CYCLE
ModifyObject(object, textarray, number);
VOID ModifyObject(CPTR, STRPTR *, ULONG);
Changes the string array of the IObject, cycle, and the number of
selected option.
textarray - the text array you want or NULL if you don't want to change it.
number - the selected option in the text array.
CLASS_SCROLLER
ModifyObject(object, position, visible, max);
VOID ModifyObject(CPTR, ULONG, ULONG, ULONG);
Changes Knob position, visble size and maximal size.
position - position of the Knob.
visible - visible size of the scroller.
max - maximal size of the scroller.
CLASS_BUTTON
ModifyObject(object, select);
VOID ModifyObject(CPTR, BOOL);
Select or unselect the button (the button must have the flag BT_TOGGLE
set.)
select - TRUE if you want the button to be selected.
CLASS_INTEGER
ModifyObject(object, val, min, max);
VOID ModifyObject(CPTR, LONG, LONG, LONG);
Changes the value of the integer and its minimum and maximum.
val - value of the integer.
min - minimum size of the integer.
max - maximal size of the integer.
CLASS_STRING
ModifyObject(object, text);
VOID ModifyObject(CPTR, STRPTR);
Changes the IObject text.
text - the new text to be put in the String.
CLASS_CHECK
ModifyObject(object, select);
VOID ModifyObject(CPTR, BOOL);
Marks or not the Check.
select - TRUE to mark the CheckBox.
RESULT
none
BUGS
none known
IObject.lib/ObjectValue IObject.lib/ObjectValue
NAME ObjectValue() -- Returns IObject value
val = ObjectValue(object);
CPTR ObjectValue(CPTR); (the type of val depends of IObject classe)
DESCRIPTION
Returns IObject value.
INPUTS
object - pointer to IObject.
RESULT
CLASS_CYCLE:
index = ObjectValue(object);
UWORD ObjectValue(CPTR);
returns the number of selected option.
CLASS_SCROLLER:
pos = ObjectValue(object);
UWORD ObjectValue(CPTR);
returns knob position.
CLASS_BUTTON:
select = ObjectValue(object);
BOOL ObjectValue(CPTR);
returns TRUE if the button is selected.
CLASS_INTEGER:
val = ObjectValue(object);
LONG ObjectValue(CPTR);
Returns the integer.
CLASS_STRING:
texte = ObjectValue(object);
STRPTR ObjectValue(CPTR);
Returns pointer to string.
CLASS_CHECK:
select = ObjectValue(object);
BOOL ObjectValue(CPTR);
returns TRUE is the IObject is marked.
BUGS
none known
IObject.lib/OffObject IObject.lib/OffObject
NAME OffObject() -- Ghoste an IObject
OffObject(object);
VOID OffObject(CPTR);
DESCRIPTION
Ghost the IObject, to unghost the IObject use OnObject().
INPUTS
object - pointer to IObject.
RESULT
none
BUGS
none known
SEE ALSO
OnObject()
IObject.lib/OnObject IObject.lib/OnObject
NAME OnObject() -- UnGhoste an IObject
OnObject(object);
VOID OnObject(CPTR);
DESCRIPTION
Unghost the IObject.
INPUTS
object - pointer to IObject.
RESULT
none
BUGS
none known
SEE ALSO
OffObject()
IObject.lib/RemoveObjectFromWindow IObject.lib/RemoveObjectFromWindow
NAME RemoveObjectFromWindow() -- Remove an IObject from its window
RemoveObjectFromWindow(object);
VOID RemoveObjectFromWindow(CPTR);
DESCRIPTION
Remove an IObject from its window. The IObject isn't erased, to erase it
use EraseObject() before removing it.
INPUTS
object - pointer to IObject.
RESULT
none
BUGS
none known
SEE ALSO
AddObjectToWindow(), EraseDisplay()
IObject.lib/SendMsgToObject IObject.lib/SendMsgToObject
NAME SendMsgToObject() -- Send an IntuiMessage to an IObject
modif = SendMsgToObject(object, message);
BOOL SendMsgToObject(CPTR, struct IntuiMessage *);
DESCRIPTION
Send an IntuiMessage to an IObject, the IObject come from FindObjectMsg(),
return TRUE if the IObject was modified by the message. You must use
ObjectValue() to get the new value.
INPUTS
object - pointer to IObject.
message - pointer to an IntuiMessage structure.
RESULT
modif - returns TRUE if the IObject was modified or FALSE else.
BUGS
none known
SEE ALSO
FindObjectMsg(), ObjectValue()
IObject.lib/SetTextAreaPen IObject.lib/SetTextAreaPen
NAME SetTextAreaPen() -- Changes colors for the TextArea
SetTextAreaPen(textarea, front, back);
VOID SetTextAreaPen(CPTR, UBYTE, UBYTE);
DESCRIPTION
Changes pens colors for the TextArea. If you change the back pen you should
clear the TextArea after.
INPUTS
textarea - pointer to the TextArea.
front - pen color for the text.
back - color for the background.
RESULT
none
IObject.lib/SetIObjectColors IObject.lib/SetIObjectColors
NAME SetIObjectColors() -- Initialize couleurs for IObject.lib
SetIObjectColors(back, light, dark, pen1, pen2);
VOID SetIObjectColors(UBYTE, UBYTE, UBYTE, UBYTE, UBYTE);
DESCRIPTION
Initilize colors used by IObject.lib to draw 3D border, to erase IObjects
and for the labels.
INPUTS
back - color use to erase the IObjects.
light - color for light side of borders.
dark - color for dark side of borders.
pen1 - default color for labels.
pen2 - color for labels using LABEL_PEN2.
RESULT
none
BUGS
none known
IObject.lib/TAPrint IObject.lib/TAPrint
NAME TAPrint() -- Write a text in an TextArea
TAPrint(textarea, text);
TAPrint(CPTR, STRPTR);
DESCRIPTION
Write text in an TextArea. You can use '\n' in the text.
INPUTS
textarea - pointer to the TextArea.
text - the text to display.
RESULT
none
BUGS
TABS doesn't work.
SEE ALSO
TAPrintf(), TAPuts()
IObject.lib/TAPrintf
NAME TAPrintf() -- Display a formated text in an TextArea
TAPrintf(textarea, fmttext, arg1, arg2, ...);
VOID TAPrintf(CPTR, STRPTR, ...);
DESCRIPTION
Display a text in a TextArea ala printf.
INPUTS
textarea - pointer to TextArea.
fmttext - text with formating styles.
arg1, arg2, ... - parameters for the fmttexte.
RESULT
none
BUGS
none known
SEE ALSO
RawDoFmt(), TAPuts(), TAPrint()
IObject.lib/TAPuts IObject.lib/TAPuts
NAME TAPuts() -- Display a text in an TextArea, do a carriage return after
TAPuts(textarea, texte);
VOID TAPuts(CPTR,char *);
DESCRIPTION
The same as TAPrint(), except the carriage return.
INPUTS
textarea - pointer to textarea.
texte - text to display.
RESULT
none
BUGS
TABS doesn't work.
SEE ALSO
TAPrintf(), TAPrint()